<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>

<%@ include file="/common/taglib.jsp" %>

<!DOCTYPE html>
<html>
<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title><spring:message code="role.manager"/></title>

<%@ include file="/common/css.jsp" %>
<%@ include file="/common/javascript.jsp" %>

<script type="text/javascript">
<!--
jQuery(function(){
	// save
	jQuery( "#save" ).button().click(function(){
		jQuery('#action').val('saveEdit');
		jQuery("form").submit();
	});

	// save and new	
	jQuery( "#saveNew" ).button().click(function(){
		jQuery('#action').val('saveEdit');
		jQuery('#saveAndNew').val('saveAndNew');
		jQuery("form").submit();
	});
	
	// back
	jQuery( "#back" ).button().click(function(){
		// form reset
		jQuery("input").each(function(){
			jQuery(this).val('');
		});
		jQuery('#action').val('list');
		jQuery("form").submit();
	});

	// disable right click
	jQuery(document).bind("contextmenu",function(e){   
        return false;   
    });
});
//-->
</script>

</head>

<body>
	<div id="msgDIV" style="margin:0px; padding:0px;"><ui:message code="${code}" isError="${isError}"/></div>
		<form:form id="saveEditForm" method="post" action="/admin/role.do">
		<form:hidden path="action"/>
		<form:hidden path="saveAndNew"/>
		<form:hidden path="roleId"/>
			<fieldset>
				<table id="formTable" class="ui-widget ui-widget-content"  style="width:100%">
					<thead>
						<tr class="ui-widget-header">
							<td colspan="4">
<!--								<button id="save"><spring:message code="save"/></button>-->
<!--								<button id="back"><spring:message code="back"/></button>-->
									<input type="button" id="save" value="<spring:message code="save"/>">
									<input type="button" id="saveNew" value="<spring:message code="save.and.new"/>">
									<input type="button" id="back" value="<spring:message code="back"/>">
							</td>
						</tr>
					</thead>
					<tbody>
						<tr>				
							<td><spring:message code="role.roleCode"/></td>
							<td><spring:message code="role.roleName"/></td>
						</tr>
						<tr>
							<td><form:input path="roleCode"/></td>
							<td><form:input path="roleName"/></td>
						</tr>
						<tr>
							<td colspan="2"><spring:message code="row.enable"/></td>
						</tr>
						<tr>
							<td colspan="2">
								<form:select path="rowEnable" id="rowEnable">
									<form:option value="1"><spring:message code="row.enable"/></form:option>
									<form:option value="0"><spring:message code="row.disable"/></form:option>
								</form:select>
							</td>
						</tr>
						<tr>
							<td colspan="2"><spring:message code="role.roleExplain"/></td>
						</tr>
						<tr>
							<td colspan="2"><form:textarea path="roleExplain" cols="80" rows="6"/></td>
						</tr>
						
					</tbody>
				</table>
			</fieldset>
		</form:form>


</body>
</html>